/**
 * 
 */
package com.uuticketweb.ticket.manager.bean;

import java.util.Comparator;

/**
 * @author stephen
 *
 */
public class TripComparator implements Comparator {

	/* (non-Javadoc)
	 * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
	 */
	public int compare(Object arg0, Object arg1) {
		Trip trip0 = (Trip)arg0;
		Trip trip1 = (Trip)arg1;
		if (trip0.getPrice() > trip1.getPrice()) {
			return 1;
		} else {
			if(trip0.getPrice() == trip1.getPrice()) {
				return 0;
			} else {
				return -1;
			}
		}
	}

}
